Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile history pages #80

Merged
merged 30 commits into from
Nov 13, 2024
Merged

Profile history pages #80

merged 30 commits into from
Nov 13, 2024

Conversation

LimZiJia
Copy link

@LimZiJia LimZiJia commented Nov 5, 2024

Profile Page

Users when signed in, will be able to see their profile page. It has their Username and Email displayed. They have two options, to edit their profile information (Username and Email) or change their password.
image

Both changing profiles and changing passwords requires validation of old password. This is done by an additional login before a to the user service endpoint.
image
image

History Page

GET from the history service endpoint and displays matching history information in a table, sorted by time. A successful submit with status 'COMPLETED' will be marked with a ✔️, 'FORFEITED' will be a ❌ , and 'IN_PROGRESS' will be a loading spinning circle.
Maybe bug: The loading spinning circle doesnt spin on my side, even primeng spinning icon page does not work for me.
image

  • I have updated documentation
  • All tests passing

Fixes #22 #23

Profile page is under '/account' route. It allows users to change
account details and password.

I moved around some files and refactored getters from register.component into
forms.utils.service.

Slightly changed behavior of user service update user. Did not
understand what it was trying to do before, so I changed it to work. It
feels like it works, but not extensively tested.

Known bugs: (1) Enter does not submit edit forms. (2) Edit profile form does not
inherit theme from primeng.
Branch has not merged with history service, so although history service
is made, it is not being used.
Bugs fixed: Imported PInputText so editing profile page looks normal. The behaviour for 'Enter' to submit form is restored for profile page.

Not Fixed: Linting.
Added interfaces for hisotry response.
Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes needed, I think for now the priority for the demo is requiring password, table sorting, and success messages.

frontend/src/app/account/profile/profile.component.html Outdated Show resolved Hide resolved
frontend/src/app/account/profile/profile.component.html Outdated Show resolved Hide resolved
frontend/src/app/account/profile/profile.component.ts Outdated Show resolved Hide resolved
frontend/src/_services/form.utils.service.ts Show resolved Hide resolved
frontend/src/app/account/history/history.model.ts Outdated Show resolved Hide resolved
frontend/src/app/account/profile/profile.component.ts Outdated Show resolved Hide resolved
frontend/src/app/account/profile/profile.component.ts Outdated Show resolved Hide resolved
frontend/src/app/account/profile/profile.component.ts Outdated Show resolved Hide resolved
samuelim01 and others added 9 commits November 8, 2024 01:01
Most of it has been fixed, except for changing how user service works.
Similar to questions page, there is a sliding window to view the last
snapshot of the coding session before forfeit or submit.

History table is now searchable.

Profile page now properly subscribes to user$ and does not need to
refresh.

Known bugs: during a colab session, cannot view history page. No idea
how to debug since it did not show errors or any console.log()
Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good but needs a few fixes

frontend/src/_services/collab.service.ts Outdated Show resolved Hide resolved
Comment on lines +19 to +32
<ng-template pTemplate="caption">
<div class="flex">
<p-iconField iconPosition="left" class="ml-auto">
<p-inputIcon>
<i class="pi pi-search"></i>
</p-inputIcon>
<input
pInputText
type="text"
(input)="dt.filterGlobal($any($event.target).value, 'contains')"
placeholder="Search keyword" />
</p-iconField>
</div>
</ng-template>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search.mp4

I think we might need to ensure that the size doesn't keep changing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD in another branch

frontend/src/app/account/history/history.component.ts Outdated Show resolved Hide resolved
frontend/src/app/account/history/history.component.ts Outdated Show resolved Hide resolved
frontend/src/_services/history.service.ts Outdated Show resolved Hide resolved
frontend/src/app/account/history/history.component.ts Outdated Show resolved Hide resolved
frontend/src/app/account/history/history.component.ts Outdated Show resolved Hide resolved
frontend/src/app/account/profile/profile.component.ts Outdated Show resolved Hide resolved
samuelim01 and others added 9 commits November 12, 2024 20:22
* Redefine zod schemas for better reusability
* Add route to handle update to user's username and email
* Add route to handle update to user's password
* Shift buttons out of profile container
* Display profile details as text instead of readonly input
Remove the need for the frontend to send the final code and language
Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samuelim01 samuelim01 merged commit 3164014 into main Nov 13, 2024
6 checks passed
@samuelim01 samuelim01 mentioned this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add History Component
3 participants